package com.szeastroc.core.mapper.system;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.szeastroc.core.base.mapper.BaseMapper;
import com.szeastroc.core.bean.system.SystemUserRole;

public interface SystemUserRoleMapper extends BaseMapper<SystemUserRole>{
    @Update("update t_system_user_role set role_id = #{roleId} where user_id = #{userId}")
    public void updateUserRole(@Param("userId") Integer userId,@Param("roleId")Integer roleId);
    
    @Select("select * from t_system_user_role where role_id = #{roleId} and user_id = #{userId}")
    public SystemUserRole selectByUserIdAndRoleId(@Param("userId") Integer userId,@Param("roleId")Integer roleId);
    
    @Delete("delete from t_system_user_role where role_id = #{roleId} and user_id = #{userId}")
    public void deleteByUserIdAndRoleId(@Param("userId") Integer userId,@Param("roleId")Integer roleId);
    
}
